const NewsModel = require("../../models/NewsModel")

const NewsService = {
    getList: async (id) => {
        if (id !== 'all') {
            return NewsModel.find({
                _id: id,
                isPublish: 1
            }).sort({
                updateTime: -1
            })
        }
        return NewsModel.find({
            isPublish: 1
        }).sort({
            updateTime: -1
        })
    },

}

module.exports = NewsService